package com.zhitan.netty.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum PileModelEnum {

    /**
     * 桩型号 0x01：直流  0x02：交流
     */
    DC((byte) 1, "直流"),
    AC((byte) 2, "交流");

    private final byte code;
    private final String message;

    public static PileModelEnum match(int key) {
        PileModelEnum result = null;
        for (PileModelEnum s : values()) {
            if (s.getCode() == key) {
                result = s;
                break;
            }
        }
        return result;
    }
}
